import { http } from '@/utils/http/axios';

/**
 * @description: 添加配置
 */
export function addConfig(params) {
  return http.request({
    url: '/config/add',
    method: 'post',
    params,
  });
}

/**
 * @description: 删除配置
 */
export function deleteConfig(params) {
  return http.request({
    url: '/config/delete',
    method: 'post',
    params,
  });
}

/**
 * @description: 编辑配置
 */
export function editConfig(params) {
  return http.request({
    url: '/config/edit',
    method: 'post',
    params,
  });
}

/**
 * @description: 配置列表
 */
export function configList(params) {
  return http.request({
    url: '/config/list',
    method: 'get',
    params,
  });
}

/**
 * @description: 配置详情
 */
export function configInfo(params) {
  return http.request({
    url: '/config/info',
    method: 'get',
    params,
  });
}

/**
 * @description: 导出配置
 */
export function exportConfig(params?) {
  return http.request(
    {
      url: '/config/export',
      method: 'post',
      params,
      //responseType: 'blob', // 二进制流
    },
    {
      isReturnNativeResponse: true,
    },
  );
}
